const path = require('path');
const webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
	.BundleAnalyzerPlugin;

function resolve (dir) {
	return path.join(__dirname, dir);
}

module.exports = {
	mode : 'production',
	entry : {
		dll : [
			'axios',
			'fastclick',
			'jsonp',
			'mint-ui',
			'nprogress',
			'vue/dist/vue.js',
			'vue-router',
			'vuex',
			'vuex-persistedstate'
		]
	},
	output : {
		path : resolve('dll'),
		filename : '[name]_[chunkhash:8].js',
		library : '[name]_[chunkhash:8]'
	},
	plugins : [
		new webpack.DllPlugin({
			name : '[name]_[chunkhash:8]',
			path : resolve('dll') + '/[name]_manifest_[chunkhash:8].json'
		}),
		new BundleAnalyzerPlugin()
	]
};
